//
//  Extension.swift
//  test
//
//  Created by 이웅재 on 2021/08/27.
//

import SwiftUI

public extension RichText {
    func lineHeight(_ lineHeight: CGFloat) -> RichText {
        var result = self
        
        result.lineHeight = lineHeight
        return result
    }
    
    func imageRadius(_ imageRadius: CGFloat) -> RichText {
        var result = self
        
        result.imageRadius = imageRadius
        return result
    }
    
    func fontType(_ fontType: fontType) -> RichText {
        var result = self
        
        result.fontType = fontType
        return result
    }
    
    func colorScheme(_ colorScheme: colorScheme) -> RichText {
        var result = self
        
        result.colorScheme = colorScheme
        return result
    }
    
    func colorImportant(_ colorImportant: Bool) -> RichText {
        var result = self
        
        result.colorImportant = colorImportant
        return result
    }
    
    func placeholder<T>(@ViewBuilder content: () -> T) -> RichText where T: View {
        var result = self
        
        result.placeholder = AnyView(content())
        return result
    }
    
    func linkOpenType(_ linkOpenType: linkOpenType) -> RichText {
        var result = self
        
        result.linkOpenType = linkOpenType
        return result
    }
    
    func linkColor(_ linkColor: ColorSet) -> RichText {
        var result = self
        
        result.linkColor = linkColor
        return result
    }

    func imageClick(_ block: ((Int, [String]) -> Void)?) -> RichText {
        var result = self
        
        result.imageClick = block
        return result
    }
}
